jQuery(c=>{c(`
`).appendTo("body");const h=c('').appendTo("head"),l=()=>{const e=jQuery,a=document.documentElement.clientWidth,d=e("#debug .site-grid").width(),n=e("#debug .column").width(),t=e("#debug").width(),s=e("#debug .site-grid").css("column-gap"),o=e("#debug .content-width").width(),i=(e(".desktop-header-utility").outerHeight()||0)+(e(".desktop-header-nav").outerHeight()||0)+(e(".breadcrumbs").outerHeight()||0);h[0].innerHTML=`
:root {
--js-opacity: 1;
--viewport-width: ${a}px;
--column-width: ${n}px;
--grid-width: ${d}px;
--container-width: ${t}px;
--gap-width: ${s};
--content-width: ${o}px;
--header-height: ${i}px;
}
`};l(),c(document).ready(()=>{new ResizeObserver(l).observe(document.documentElement)}),window.onload=()=>l(),jQuery(e=>{e(".page-header + .bg-header-extended").length&&e(document.body).addClass("is-header-extended"),e(document).on("click",".wp-block-mind-education-video button",n=>{const t=e(n.target).closest(".wp-block-mind-education-video");t.addClass("is-active"),t.find(".video-container template").each((s,o)=>{e(o).replaceWith(e(o).html())})}),e("body").hasClass("logged-in")&&e("body").addClass("frontend")&&(e("#wpadminbar #wp-admin-bar-top-secondary").prepend(''),localStorage.getItem("debug")==="1"&&e(document.body).addClass("debug"),e(document).on("click",".js-debug-toggle",n=>{n.preventDefault(),e(document.body).toggleClass("debug");const t=e(document.body).hasClass("debug");localStorage.setItem("debug",t?"1":"0")}),e("[data-block-name]").each((n,t)=>{const s=e(t).attr("data-block-name");e(t).addClass("relative").prepend(`${s}
`)})),e(".wp-block-testimonial-slider, .wp-block-image-slider").each((n,t)=>{e(t).find(".inner-container").addClass("swiper").wrapInner('').append(''),e(t).find(".swiper-wrapper").children().addClass("swiper-slide"),new Swiper(e(t).find(".swiper")[0],{pagination:{el:e(t).find(".swiper-pagination")[0],clickable:!0,grabCursor:!0}})}),jQuery(".mobile-nav .nav > li").each((n,t)=>{const s=jQuery(t).find("> a"),o=s.clone(),i=e(``);e(t).find(".sub-menu").wrap(''),e(t).find(".sub-menu-container").prepend(o).prepend(i),i.on("click",()=>{e(t).removeClass("is-active"),e(".mobile-nav").css("height",""),e(".mobile-header").removeClass("is-submenu-active")}),s.on("click",p=>{p.preventDefault(),e(t).addClass("is-active");const r=e(t).find(".sub-menu-container").outerHeight();e(".mobile-nav").css({height:r}),e(".mobile-header").addClass("is-submenu-active")})});const d=()=>{const n=e(".desktop-header-utility").outerHeight(),t=e(".desktop-header-logo"),s=e(window).scrollTop();t.toggleClass("is-sticky",s>=n)};e(window).on("scroll load",d),d(),e(".wp-block-programs-card").each((n,t)=>{const s=e("img",t),o=e("a",t),i=s.attr("src"),p=o.attr("href");i&&i.endsWith(".svg")&&e.get(i,r=>{const u=e(r).find("svg");u.length&&(o.replaceWith(u),e(t).wrapInner(``))}).fail(()=>{console.error(`Failed to load SVG from ${i}`)})}),e(".bg-halves").each((n,t)=>{const s=e(t).prev().css("background-color");let o=e(t).next().css("background-color");e(t).nextAll().filter((p,r)=>e(r).html().trim()!=="").length||(o=e(".wp-block-newsletter-cta").css("background-color")),s&&e(t).find(".bg-top").css("background-color",s),o&&e(t).find(".bg-bottom").css("background-color",o)})}),c(".wp-block-card[data-url], .wp-block-image-card[data-url]").each((e,a)=>{const d=c(a),n=d.data("url");if(n){const t=d.html().replace("","");d.html(t),d.wrapInner(``)}}),(()=>{const e=document.querySelectorAll("[data-type='parallax']");if(e.length===0)return;const a=new Set,d=new IntersectionObserver(s=>{s.forEach(o=>{o.isIntersecting?a.add(o.target):a.delete(o.target)})},{threshold:0});e.forEach(s=>d.observe(s));let n=!1;function t(){const s=window.pageYOffset;a.forEach(o=>{const i=o.getAttribute("data-depth"),r=`translate3d(0, ${-(s*i)}px, 0)`;o.style.transform=r}),n=!1}window.addEventListener("scroll",function(){n||(window.requestAnimationFrame(t),n=!0)})})()});document.addEventListener("alpine:init",()=>{const c=window.location.search,l=new URLSearchParams(c).get("s");Alpine.data("search",()=>({suggestions:[],search:l,showSuggestions:!1,updatedInput(){this.search===""?this.showSuggestions=!1:this.showSuggestions=!0},autocomplete(){jQuery.get("/wp-json/wp/v2/search",{search:this.search,per_page:4},e=>{e=e.map(a=>(a.post_type_label=a.subtype==="post"?"Resource":a.subtype.replace("-"," "),a)),this.suggestions=e,this.updatedInput()})},submit(){console.log("submit"),document.location.href=`/?s=${this.search}`},close(){this.search="",this.$store.MindEducation.toggle("search",!1)}})),Alpine.data("card",()=>({isModalOpen:!1,openModal(){this.isModalOpen=!0},closeModal(){this.isModalOpen=!1}}))});